package com.ad_hccm.dao.GeneralInformation;

import com.ad_hccm.domain.GeneralInformation.Smoke;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * TODO 吸烟史Dao
 */
@Mapper
public interface SmokeDao {
    @Insert("insert into smoke value(#{id}, #{branch}, #{year})")
    public boolean save(Smoke smoke);

    @Update("update smoke set branch = #{branch}, year = #{year} where id=#{id}")
    public boolean update(Smoke smoke);

    @Select("select * from smoke where id=#{id}")
    public Smoke getById(String id);

    @Select("select * from smoke")
    public List<Smoke> getAll();
}
